/*    */ package net.noday.cloudlog.util;
/*    */ 
/*    */ import java.io.PrintStream;
/*    */ import java.sql.Date;
/*    */ import java.sql.Timestamp;
/*    */ import java.util.Calendar;
/*    */ 
/*    */ public class DBUtils
/*    */ {
/*    */   private static final String DBTYPE_C = "C_";
/*    */   public static final String DBTYPE_VARCHAR = "C_";
/*    */   public static final String DBTYPE_DATE = "D_";
/*    */   public static final String DBTYPE_TIMESTAMP = "T_";
/*    */   public static final String DBTYPE_NUMBER = "N_";
/*    */   public static final String DBTYPE_DOUBLE = "F_";
/*    */   public static final String DBTYPE_CLOB = "L_";
/*    */   public static final String DBTYPE_BLOB = "B_";
/*    */ 
/*    */   public static String getDBPreFixByParameterType(Class type)
/*    */   {
/* 20 */     String result = null;
/* 21 */     String typeClassName = type.getName();
/* 22 */     if (typeClassName == null)
/* 23 */       result = "C_";
/* 24 */     else if (type.equals(String.class))
/* 25 */       result = "C_";
/* 26 */     else if (type.equals(Double.TYPE))
/* 27 */       result = "F_";
/* 28 */     else if (type.equals(Double.class))
/* 29 */       result = "F_";
/* 30 */     else if (type.equals(Date.class))
/* 31 */       result = "D_";
/* 32 */     else if (type.equals(Integer.class))
/* 33 */       result = "N_";
/* 34 */     else if (type.equals(Integer.TYPE))
/* 35 */       result = "N_";
/* 36 */     else if (type.equals(Calendar.class))
/* 37 */       result = "T_";
/* 38 */     else if (type.equals(Timestamp.class))
/* 39 */       result = "T_";
/*    */     else {
/* 41 */       result = "C_";
/*    */     }
/* 43 */     return result;
/*    */   }
/*    */ 
/*    */   public static void main(String[] args) {
/* 47 */     String a = "";
/* 48 */     String type = getDBPreFixByParameterType(String.class);
/* 49 */     System.out.println(type);
/*    */   }
/*    */ }

/* Location:           D:\work\tomcat\webapps\thfees\WEB-INF\classes\
 * Qualified Name:     com.doer.uitl.DBUtils
 * JD-Core Version:    0.6.0
 */